<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
		<meta name="format-detection" content="telephone=no" />
		<title>首页</title>
		<link rel="stylesheet" type="text/css" href="../c/aui.css" />
		<link rel="stylesheet" type="text/css" href="../c/suxiangw.css" />
		<style>
			body,html{
			background-color: transparent;
			position: absolute;
			bottom: 0;
			top: 0;
			right: 0;
			left: 0;
			/*background-color:#f00;*/
			background-image: -webkit-linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0));
			background-image: -o-linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0));
			background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0));
		}

		#sx-header {
			/*background: #f00 !important;*/
			display: flex;
			justify-content: space-between;
			padding: 0 0.45rem;
		}

		.aui-btn img {
			width: 1rem;
		}

		.aui-title span {
			margin: 0 0.35rem;
			font-size: 0.8rem;
			opacity: 0.7;
		}

		.aui-title span.a {
			font-weight: bold;
			opacity: 1;
			-webkit-transition: all .3s;
			transition: all .3s;
			font-size: 0.85rem;
		}

		.aui-bar-nav .aui-title {
			left: 0rem;
			right: 0rem;
			position: relative;
		}
		.aui-pull-right img{
			width: 1.2rem;
			height: 1.3rem;
		}
		.listgg{
			position: absolute;
			width:60%;
			left: 5%;
			top:3.5rem;
			right: 5%;
			height: 2.5rem;
			overflow: hidden;
			background: rgba(0,0,0,0.2);
		    z-index: 999;
			border-radius:5px;
		}

		.listgg ul{
			width: 100%;
			height: auto;
			position: absolute;
			transition: all 1.5s ease-in-out;
		}
		.listgg ul li{
			width: 100%;

			height: 2.5rem;

		}
		.listgg ul li img{
			float: left;
			width: 1.5rem;
			margin-top: 0.5rem;
			margin-left: 0.5rem;
			height: 1.5rem;
			float: left;
			border-radius: 50%;
		}
		.listgg ul li p{
			float: left;
			width: 70%;
			margin-left: 4%;
			line-height: 1.25rem;
			height: 1.25rem;
		}
		.listgg ul li p:nth-of-type(1) span{
            color: #FFFFFF;
            display: block;
            max-width: 60%;
            float: left;
            display: -webkit-box;
			-webkit-box-orient: vertical;
			-webkit-line-clamp: 1;
			overflow: hidden;
            font-size: 0.75rem;
		}
		.listgg ul li p:nth-of-type(1) small{
			height: 80%;
		    float: left;
		    padding: 0 7px;
		    margin-top: 0.125rem;
		    line-height: 1rem;
		    margin-left: 0.5rem;
            border-radius: 15px;
		    background: #FFC107;
		    display: block;
		}
		.listgg ul li p:nth-of-type(2) span{
			display: block;
			float: left;
			max-width: 35%;
			display: -webkit-box;
			-webkit-box-orient: vertical;
			-webkit-line-clamp: 1;
			overflow: hidden;
			font-size: 0.5625rem;
		}
		.listgg ul li p:nth-of-type(2) small{
			display: block;
			float: left;
			margin-left: 3%;
			width: 60%;
			display: -webkit-box;
			-webkit-box-orient: vertical;
			-webkit-line-clamp: 1;
			overflow: hidden;
		}
	</style>
	</head>

	<body>
		<div class="listgg" style="display: none;">
			<ul id="uls">
				<!-- <li><img src="../i/redian-img-zan.png">
					<p><span>2020.12.29</span><small>+300</small></p>
					<p><span>用户昵称</span><small>刚刚成功提现300</small></p>
				</li>-->
			</ul>
		</div>
		<header class="aui-bar aui-bar-nav" id="sx-header" style="display: none;">
			<a class="aui-pull-left aui-btn" tapmode onclick="sou()"><img src="../i/sou.png" /></a>
			<div class="aui-title t" style="height: 5rem;">
				<span tapmode onclick="a(0)">关注</span>
				<span tapmode onclick="a(1)" class="a">推荐</span>
				<span tapmode onclick="a(2)">热点</span>
				<!-- <span tapmode onclick="a(3)">的结果你打开</span> -->
			</div>
			<!-- <a class="aui-pull-right aui-btn" tapmode onclick="_url({url:'xiaoxi',title:'消息通知'},'',true)"><img src="../i/tongzhi.png" /></a> -->
			<a class="aui-pull-right aui-btn" tapmode onclick="zhibo()"><img src="../i/vip/zhibo.png" /></a>
		</header>

	</body>
	<script type="text/javascript" src="../j/api.js"></script>
	<script type="text/javascript" src="../j/jquery-3.3.1.min.js"></script>
	<script type="text/javascript">
		function urlsa() {
			var imglen = $("img").length;
			var picurls = picurl + "/vip";
			for (var i = 0; i < imglen; i++) {
				var tpl = $("img").eq(i).attr("src");
				tpls = tpl.replace("../i/vip", picurls);
				$("img").eq(i).attr("src", tpls);
		
			}
		}
		var header_h = 0
		var i = -1;
		var t = 0;
		var s;
		//公告
		function set(i) {
			s = setInterval(function() {
				i++;
				var len = $("#uls li").length;
				if (i >= (len - 1)) {
					$(".listgg ul").css("top", "-" + (i * 2.5) + "rem");
					// $(".listgg ul").html("");
					t++;
					_ajax1('withdrawal/index', function(ret, err) {
						if (ret.length > 0 && ret != "") {
							len = Number(len) + Number(ret.length);
							var str = '';
							for (var i = 0; i < ret.length; i++) {
								str += '<li>';
								if (ret[i].img == null || ret[i].img == "null") {
									str += '<img src="' + picurl + '/redian-img-zan.png">';
								} else {
									str += '<img src="' + _img(ret[i].img) + '">';
								}
								str += '<p><span>' + ret[i].time + '</span><small>+' + ret[i].money + '</small></p>';
								str += '<p><span>' + ret[i].nickname + '</span><small>刚刚成功提现' + ret[i].money + '</small></p>';
								str += '</li>';

							}
							document.getElementById("uls").innerHTML = str;
							clearTimeout(s);
							i = -1;
							set(i);
							$(".listgg").css("display", "block");
							// $(".listgg ul").css("top", "-" + (i * 2.5) + "rem");
							// break
						} else {
							clearTimeout(s);
							i = -1;
							set(i);
							if ($("#uls li").length > 0) {
								$(".listgg").css("display", "block");
							} else {
								$(".listgg").css("display", "none");
							}
						}

					}, {
						page: t
					})
				} else {

					$(".listgg ul").css("top", "-" + (i * 2.5) + "rem");
				}
			}, 4500)
		}
		apiready = function() {
			urlsa();
			api.parseTapmode();
			header_h = $api.byId('sx-header');
			_gengxin();
			$api.fixStatusBar(header_h)
			header_h = $api.offset(header_h).h;
			var len = 0;
			set(i);
			// 回到屏幕
			api.addEventListener({
				name: 'viewappear'
			}, function(ret, err) {
				// alert("ss");
				// clearTimeout(s);
				_ajax1('withdrawal/index', function(ret, err) {

					if (ret.length > 0 && ret != "") {
						len = Number(len) + Number(ret.length);
						var str = '';
						for (var i = 0; i < ret.length; i++) {
							str += '<li>';
							if (ret[i].img == null || ret[i].img == "null") {
								str += '<img src="' + picurl + '/redian-img-zan.png">';
							} else {
								str += '<img src="' + _img(ret[i].img) + '">';
							}
							str += '<p><span>' + ret[i].time + '</span><small>+' + ret[i].money + '</small></p>';
							str += '<p><span>' + ret[i].nickname + '</span><small>刚刚成功提现' + ret[i].money + '</small></p>';
							str += '</li>';

						}
						document.getElementById("uls").innerHTML = str;
						clearTimeout(s);
						i = -1;
						set(i);
						$(".listgg").css("display", "block");
					} else {
						clearTimeout(s);
						i = -1;
						set(i);
						$("#uls").html("");
						if ($("#uls li").length > 0) {
							$(".listgg").css("display", "block");
						} else {
							$(".listgg").css("display", "none");
						}
					}

				}, {
					page: t
				})

			})

			api.setFrameAttr({
				name: 'index_header',
				rect: {
					x: 0,
					y: 0,
					w: 'auto',
					h: header_h,
				}
			});
			// article_loading();

		}

		function a(i) {
			if (i == 1) {

			} else {
				api.execScript({
					frameName: 'oxPlayer_frm',
					script: 'isPlaying();'
				});

			}
			api.setFrameGroupIndex({
				name: 'index',
				index: i,
				scroll: true,
			});
			cla(i)
		}

		function cla(i) {
			$('.t .a').removeClass('a');
			$('.t span').eq(i).addClass('a');
		}

		function htmls() {
			api.execScript({
				frameName: 'index_list_1',
				script: 'htmls()'
			});
		}
		// 搜索
		function sou() {
			var UISearchBar = api.require('UISearchBar');
			UISearchBar.open({
				placeholder: '请输入搜索关键字',
				historyCount: 10,
				showRecordBtn: false,
				texts: {
					cancelText: '取消',
					clearText: '清除搜索记录'
				},
				styles: {
					navBar: {
						bgColor: '#161823',
						borderColor: '#161823'
					},
					searchBox: {
						color: '#000',
						height: 44,
					},
					cancel: {
						bg: 'rgba(0,0,0,0)',
						color: '#ffffff',
						size: 16
					},
					list: {
						color: '#fff',
						bgColor: '#161823',
						borderColor: '#161823',
						activeBgColor: '#161823',
						size: 16
					},
					clear: {
						color: '#90929E',
						borderColor: '#161823',
						size: 16
					}
				}
			}, function(ret, err) {
				if (ret) {
					console.log(JSON.stringify(ret));
					if (ret.text) {
						_url({
							url: 'search',
							title: '搜索' + ret.text,
							text: ret.text
						})
					}
				} else {
					console.log(JSON.stringify(err));
				}
			});
		}
		// 显示发布进度
		function video_loading(data) {
			data = eval('(' + data + ')');
			var url = 'index_video_loading';
			// alert(header_h)
			api.openFrame({
				name: url,
				url: _h_w + url + '.html',
				rect: {
					x: 20,
					y: header_h + 10,
					w: 80,
					h: 110,
				},
				pageParam: data,
				bgColor: 'rgba(0,0,0,0)',
			})
		}

		function zhibo() {
			if (_getPrefs('_config').config.app == 1) {

			} else {
				_url({
					url: 'zhibo_index',
					title: '直播'
				}, '', true)
			}
		}

		function header(a) {
			console.log(a)
			api.execScript({
				frameName: a,
				script: 'header(' + (header_h - 15) + ');'
			});

		}
		// 社交进度
		function article_loading(data) {
			data = eval('(' + data + ')');
			var url = 'article_loading';
			// alert(header_h)
			api.openFrame({
				name: url,
				url: _h_w + url + '.html',
				rect: {
					x: 0,
					y: header_h + 10,
					w: 0,
					h: 0,
				},
				pageParam: data,
				bgColor: 'rgba(0,0,0,0)',
			})
		}
	</script>

</html>
